# -*- coding: utf-8 -*-
"""
Created on Thu May 30 09:39:50 2024

@author: 48848
"""
"""
class Car():
    
    def __init__(self, brand, model, year):
        self.brand = brand
        model = model
        year = year
        mile = 0
        
    def display(self):
        print(f"This car is a {brand} {model} made in {year}. It's mile is {mile}")

      
class Test:
    
    def __init__(self, foo):
        self.__foo = foo
        
    def __bar(self):
        print(self.__foo)
        print("__bar")
        
def main():
    test = Test("Hello")
    
    test.__bar()
    print(test.__foo)

"""
import time
class Clock():
    
    def __init__(self, hour = 0, minute = 0, second = 0):
        # 初始化方法
        self.hour = hour
        self.minute = minute
        self.second = second
        
    def run(self):
        # 走字
        self.second += 1
        if self.second == 60:
            self.second = 0
            self.minute += 1
            if self.minute == 60:
                self.minute = 0
                self.hour += 1
                if self.hour == 24:
                    self.hour = 0
    def show(self):
        return "%02d:%02d:%02d" % (self.hour,self.minute,self.second)

def main():
    clock = Clock()
    while True:
        print(clock.show())
        time.sleep(1)
        clock.run()